package com.gis.enums;

public enum ApiErrorCode {
    // 通用
    SUCCESS(200, "操作成功"),
    FAIL(500, "操作失败"),
    PARAM_ERROR(400, "参数错误"),
    UNAUTHORIZED(401, "未授权"),
    NOT_FOUND(404, "资源不存在"),

    // 用户相关
    USER_EXISTS(1001, "用户名已存在"),
    USER_NOT_FOUND(1002, "用户不存在"),
    PASSWORD_ERROR(1003, "密码错误"),


    // 文件相关
    FILE_EXISTS(2001, "同名文件已存在"),
    FILE_FORMAT_ERROR(2002, "文件格式不符合标准"),
    FILE_NOT_FOUND(2004, "文件不存在");

    private final int code;
    private final String message;

    ApiErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() { return code; }
    public String getMessage() { return message; }
}
